//
//  DLUserSettingVC.m
//  AllPass
//
//  Created by apple on 2021/11/1.
//

#import "DLUserSettingVC.h"
#import "DLUserSettingSwitchCell.h"
@interface DLUserSettingVC ()
@property(nonatomic,retain)NSArray * titleArr;
@end

@implementation DLUserSettingVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titleArr = @[@[NSLocalizedString(@"Use Jiangou cloud", nil)],@[]];
    [self createUI];
}
#pragma mark 代理方法
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.titleArr.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    NSArray * arr = self.titleArr[section];
    return arr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DLUserSettingSwitchCell * cell = [tableView dequeueReusableCellWithIdentifier:@"DLUserSettingSwitchCell"];
    if (!cell) {
        cell = [[DLUserSettingSwitchCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DLUserSettingSwitchCell"];
    }
    cell.name = self.titleArr[indexPath.section][indexPath.row];
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 10;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.01;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return nil;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return nil;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}
-(void)createUI{
    self.myTab = [[UITableView alloc]initWithFrame:Frame(0, kTopHeight, SCREEN_WIDTH, SCREEN_HEIGHT - kTopHeight - kTabbarHeight) style:UITableViewStyleGrouped];
    self.myTab.delegate = self;
    self.myTab.dataSource = self;
    [self.view addSubview:self.myTab];
    [self.myTab registerNib:[UINib nibWithNibName:@"DLUserSettingSwitchCell" bundle:nil] forCellReuseIdentifier:@"DLUserSettingSwitchCell"];
}
@end
